<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      > 

    <h:head> 
        <title>Remove Venue Layout For TCube Admin</title> 
        <style type="text/css"> 

            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            } 
        </style> 
    </h:head>
    <h:body>
        <h1>Stakeholder Account and Billing Management (TCube)</h1> 
        <p:layout style="table-layout:auto; height:700px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                <h:form id="TCubeMenu">
                    <h:commandLink value="Add Stakeholder" action="addstakeholder.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Stakeholder" action="deletestakeholder.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify Stakeholder" action="modifystakeholder.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Add Venue" action="addvenue.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Venue" action="deletevenue.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify Venue" action="modifyvenue.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Layout" action="deletelayout.xhtml?faces-redirect=true"/>
                    <br/>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="center" header="Delete Layout" scrollable="true">
                <h:form id="venueUpdateForm">
                    <p:dataTable value="#{stakeholderPerformanceMB.getAllVenues()}" var="venue"
                                 onRowSelectUpdate="venueUpdateForm"
                                 selection="#{stakeholderPerformanceMB.venue}"
                                 selectionMode="single"
                                 rowSelectListener="#{stakeholderPerformanceMB.updateSelectedVenueFields()}"
                                 styleClass="order-table"
                                 paginator="true"
                                 rows="5"
                                 >

                        <p:column>
                            <f:facet name="header">Venue Name</f:facet>
                            <h:outputText id="name" value="#{venue.name}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Address</f:facet>
                            <h:outputText id="commissionPercent" value="#{venue.address}"  />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Capacity</f:facet>         
                            <h:outputText value="#{venue.capacityCap}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Latitude</f:facet>
                            <h:outputText value="#{venue.latitude}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Longitude</f:facet>
                            <h:outputText value="#{venue.longitude}" />
                        </p:column> 

                        <p:column>
                            <f:facet name="header">Status</f:facet>
                            <h:outputText value="#{venue.active}" />
                        </p:column>
                    </p:dataTable>
                    <br/>
                    <h3>Click on a row above to see/remove a Venue Layout</h3>
                    <p:panel id="panel" >
                        <p:ajaxStatus style="width:16px;height:16px;">
                            <f:facet name="start">
                                <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value="" />
                            </f:facet>
                        </p:ajaxStatus>
                        <p:messages />
                        <h:panelGrid columns="3">
                            <h:outputLabel for="venueName" value="Venue name: "/>
                            <h:outputLabel id="venueName" value="#{stakeholderPerformanceMB.venueName}"/>
                            <p:message for="venueName"/>
                            
                            <h:outputLabel for="venueLayout" value= "Venue Layout: "/>
                            <p:graphicImage id="venueLayout" value="#{stakeholderPerformanceMB.venueLayout}" width="500" height="400"/>
                            <p:message for="venueLayout"/>

                        </h:panelGrid>
                        <br/>

                        <br/>
                        <h:commandButton id="submitNewVenue" value="Remove Layout" onclick="if (!confirm('Are you sure you want to remove the layout of venue #{stakeholderPerformanceMB.venueName}?')) return false"
                                         action="#{stakeholderPerformanceMB.removeVenueLayout(stakeholderPerformanceMB.venueName)}" >
                        </h:commandButton>
                    </p:panel>
                </h:form>    
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>


